const db = require('./db')
let Sequelize = require('sequelize');

let Menu = db.define('sys_menu', {
        id:{
            type:Sequelize.INTEGER(11),
            unique:true,
            allowNull:false,
            primaryKey:true,
            autoIncrement:true
        },
        name: {
            type: Sequelize.STRING(10),
            allowNull: false
        },
        url: {
            type: Sequelize.STRING(150),
            allowNull: false
        },
        parent_id:{
            type: Sequelize.INTEGER(11)
        }
    },
    {
        freezeTableName: true, // 默认false修改表名为复数，true不修改表名，与数据库表名同步      
        tableName: 'sys_menu',
        timestamps: true
    }
);

module.exports = Menu;